# coding=utf-8
__author__ = 'liubin'

from flask.ext.admin import BaseView
from flask.ext.login import current_user
from flask.ext.admin.contrib.sqla import ModelView

class AuthMixin(object):
    def is_accessible(self):
        return current_user.is_authenticated()

class AuthBaseView(AuthMixin, BaseView):
    pass

class AuthModelView(AuthMixin, ModelView):
    pass